<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display" %>

<script language="JavaScript" src="<%= request.getContextPath() + "/js/calendar6.js" %>"></script>
<script language="JavaScript" src="<%= request.getContextPath() + "/js/popUP.js" %>"></script>

<script language="javascript">
function fsecretaria()
{
  document.frmauditoria.target = '_self';
  document.frmauditoria.action = '<%=request.getContextPath()%>'+'/Reportes/ControlAcceso/CASelectCriteriaMain.do';
  document.frmauditoria.submit();
}

function fsubprograma()
{
  document.frmauditoria.target = '_self';
  document.frmauditoria.action = '<%=request.getContextPath()%>'+'/Reportes/ControlAcceso/CASelectCriteriaMain.do';
  document.frmauditoria.submit();
}

function fenviar()
{
  user = document.frmauditoria.administrador.value;
  if(user == "")
  {
     alert("Por favor ingrese un usuario");
  }
  else
  {
     document.frmauditoria.target = "blank";
     document.frmauditoria.submit();
  }
}

function flimpiar()
{
  document.frmauditoria.administrador.value = "";
  document.frmauditoria.desde.value = "";
  document.frmauditoria.hasta.value = "";
}


</script>


<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
  </head>
  <body>
  <form name="frmauditoria" action="<%=request.getContextPath()+"/Reportes/ControlAcceso/CAGenerateReport.do"%>" method="GET">
  <input type="hidden" name="admincodigo"/>
  <input type="HIDDEN" name="option" value="2"/>
  <table width="99%"  border="0" cellpadding="0" cellspacing="0" widtd="100%">
   
    <tr> 
      <td height="25" colspan="12" align="center" class="titulosenblanco">
        <P>
          <strong>REPORTE CONTROL DE ACCESOS</strong>
        </P>
        <P>
          <strong>CRITERIOS DE BUSQUEDA DE REGISTROS</strong>
        </P>
      </td>
    </tr>
    
    <tr align="left"> 
       <td height="25" colspan="12" class="titulosenblanco"><table width="99%" border="0" cellpadding="0" cellspacing="0">
        
        </table></td>		
    </tr>
    
    <tr align="left">
    <td width="100%" align="center"> 
		<table width="90%" border="0" cellpadding="3" cellspacing="3">
       <tr> 
          <td width="10%" align="left" class="celdatabla">
            <STRONG>Secretaria</STRONG>
          </td>
          <td width="46%">
            <%String strCode = (String)session.getAttribute("codeSec");
              if (strCode == null)
                strCode = "";
            %>
            <logic:iterate id="secretarias" name="cSecretaria" length="1" type="com.cs.beneficios.business.model.AreaVO">
              <html:select name="secretarias"  property="codearea" value="<%=strCode%>" styleClass="form" onchange="fsecretaria()">
                <html:option value="">Seleccione una Secretaria</html:option>
                <html:options name="CodeSecretaria" labelName="Area" labelProperty="nombre" property="codearea" collection="cSecretaria"/>
              </html:select> 
            </logic:iterate>
          </td>
          
       </tr>
       <tr> 
          <td width="10%" align="left" class="celdatabla">
            <STRONG>Usuarios(*)</STRONG>
          </td>
          <td width="46%">
            <strong>
                <%
                String strNameUser = (String)request.getAttribute("nameUser");
                if(strNameUser == null)
                  strNameUser = "";
                %>
                <input type="text" Class="form" value="<%=strNameUser%>" maxlength="50" size="30" name="administrador" readonly="readonly"/>
                <a href='javascript:vpopUsers("<%=request.getContextPath()+"/jsp/reportes/auditoria/CASelectUserMain.jsp"%>");'>
                <img border="0" src="<%= request.getContextPath() + "/images/addressbook.gif" %>" alt="Seleccionar un usuario administrador" width="16" height="16" /></a>
                
            </strong>
          </td>
          
       </tr>
       <tr> 
          <td width="10%" align="left" class="celdatabla">
            <STRONG>Programa</STRONG>
          </td>
          <td width="46%">
            <%String strCodeProg = (String)request.getAttribute("codeProg");
              if (strCodeProg == null)
                strCodeProg = "";
            %>
            
            <logic:iterate id="programas" name="cProgramas" length="1" type="com.cs.beneficios.business.model.ProgramaVO">
              <html:select name="programas"  property="codePrograma" value="<%=strCodeProg%>" styleClass="form" onchange="fsubprograma()">
                <html:option value="">Seleccione un Programa</html:option>
                <html:options name="CodePrograma" labelName="Programa" labelProperty="nombre" property="codePrograma" collection="cProgramas"/>
              </html:select> 
            </logic:iterate>
          </td>
          
       </tr>
       <tr> 
          <td width="10%" align="left" class="celdatabla">
            <STRONG>Beneficio</STRONG>
          </td>
          <td width="46%">
            <%String strCodeSubProg = (String)session.getAttribute("codeSubPrograma");%>
            <logic:iterate id="subprogramas" name="cSubProgramas" length="1" type="com.cs.beneficios.business.model.SubProgramaVO">
              <html:select name="subprogramas"  property="code" value="<%=strCode%>" styleClass="form">
                <html:option value="">Seleccione un SubPrograma</html:option>
                <html:options name="CodeSubPrograma" labelName="SubPrograma" labelProperty="nombre" property="code" collection="cSubProgramas"/>
              </html:select> 
            </logic:iterate>
          </td>
          
       </tr>
       <tr>
          <td width="10%" align="left" class="celdatabla">
            <STRONG>Fecha Inicial</STRONG>
          </td>
          <td width="46%">
            <strong>
              <input type="text" Class="form" name="desde" maxlength="20" size="20" readonly="readonly"/>
                    <a href="javascript:effectiveFrom1.popup();">
                          <img src="<%= request.getContextPath() + "/images/cal.gif" %>" 
                          width="16" height="16" border="0" alt="Click para seleccionar la fecha"></a>
            </strong>
          </td>
       </tr>
       <tr>
          <td width="10%" align="left" class="celdatabla">
            <STRONG>Fecha Final</STRONG>
          </td>
          <td width="46%">
            <strong>
              <input type="text" Class="form" name="hasta"  maxlength="20" size="20" readonly value=""/>
                  <a href="javascript:effectiveUntil1.popup();">
                        <img src="<%= request.getContextPath() + "/images/cal.gif" %>" 
                        width="16" height="16" border="0" alt="Click para seleccionar la fecha"></a>
            </strong>
          </td>
       </tr>
       <tr>
          <td colspan="2" align="left" class="celdatabla">
          (*) Campo Obligatorio
          <br>
          </td>
       </tr>
    </table>
    <table width="100%" border="0">
      <tr>
        <td align="right" class="celdatabla">
          <input type="BUTTON" value="Generar" onclick="fenviar()"/>
        </td>
        <td align="left" class="celdatabla">
          <input type="BUTTON" value="Limpiar" onclick="flimpiar()"/>
        </td>
      </tr>
    </table>
	</td>
  </tr>
  </table>
  </form>
  </body>
  <script language="javascript">
    var effectiveFrom1 = new calendar1(document.forms['frmauditoria'].elements['desde'],"-",'<%=request.getContextPath()+"/js/"%>');
    var effectiveUntil1 = new calendar1(document.forms['frmauditoria'].elements['hasta'],"-",'<%=request.getContextPath()+"/js/"%>');
  </script>
</html>
